<?php
/*
 * 适配器模式
 * //目标角色
 * //源角色
 * //类适配器角色
 * //客户端
 */
//目标角色
abstract class target{
    function boFang(){

    }
    function jilu(){

    }
}
//原角色
class adaptee{
    function boFang(){
        echo "播放视频资源";
    }
}

class adpater extends target{
    private $adaptee;
    public function __construct(adaptee $adaptee)
    {
        $this->adaptee = $adaptee;
    }

    function boFang()
    {
       $this->adaptee->boFang();
    }
    function jilu()
    {
        echo "视频已播放";
    }
}
$mp4 = new adaptee();
$adapter = new adpater($mp4);
$adapter->boFang();
$adapter->jilu();